#!/bin/sh

if [ $# -ne 2 ]; then
    echo "Usage: $0 <dirname> <searchword>";
    exit 1;
fi


files=`find $1 -name "*"`;

for file in $files; do
    exec 0<$file;
    counter=1;
    while read line; do
	echo "$file: $line at line $counter" | grep $2;
	counter=$((counter+1));
    done
done

